<?php
/**
 * Created by 老吴.
 * UserMsg:砥砺前行，扬帆起航
 * email:cwwx0128@qq.com
 * QQ:1113249273
 * QQ群:925283872
 * 微信:cww0128
 * Date: 2021/4/29
 * Time: 17:19
 */

namespace app\api\validate;

use think\Validate;

class Cusaddress extends Validate

{
    protected $rule = [
        'name' => 'require|max:25',
        'mobile' => 'require|number',
        'genderstatus' => 'require',
        'detail' => 'require',
        'province' => 'require',
        'city' => 'require',
        'district' => 'require',
        'id' => 'require',
    ];

    protected $message = [
        'id.require' => 'ID必填',
        'name.require' => '姓名必填',
        'mobile.require' => '手机号必填',
        'mobile.number' => '手机号必须为数字',
        'genderstatus.require' => '称呼必填',
        'detail.require' => '详细地址必填',
        'province.require' => '省必填',
        'city.require' => '市必填',
        'district.require' => '区必填',
    ];

    protected $scene = [
        'add_address' => ['name', 'mobile', 'genderstatus', 'detail', 'province', 'city', 'district'],
        'edit_address' => ['id', 'name', 'mobile', 'genderstatus', 'detail', 'province', 'city', 'district'],
    ];

}